<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
    <!-- 事件修饰符 -->
    <div id="app">
    <div @click="handclick">
        <button @click.stop="handbuttonclick">按钮</button>
    </div>
    <form action="#" @submit.prevent="handsubmit">
        <button>提交</button>
    </form>
    <button @click.once="handbuttonclick">按钮2</button>
    </div>
    <script>
        var app = new Vue({
            el:"#app",
            methods:{
                handclick(){
                    alert('div click')
                },
                handbuttonclick(){
                    alert('button click')
                },
                handsubmit(){
                    alert('form submit')
                }
            }
        })
    </script>
</body>
</html>
